from threading import Thread
from time import sleep


def fun1(name):
    print(f"线程{name},start")        #format
    for i in range(3):
        print(f"线程:{name},{i}")
        sleep(2)
    print(f"线程{name},end")



if __name__ == '__main__':
    print("主线程，start")
    #创造线程
    t1 = Thread(target=fun1,args=("t1",))
    t2 = Thread(target=fun1, args=("t2",))
    #启动线程
    t1.start()
    t2.start()
    print("主线程，end")
